package com.infore.qualityControl.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.qualityControl.bo.QualityParamSelectBo;
import com.infore.qualityControl.bo.QualityParamSetBo;
import com.infore.qualityControl.select.util.PageObject;
import com.infore.qualityControl.service.IQualityControlSetService;
import com.infore.qualityControl.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 质控设置控制器
 * 
 * @author Cold
 *
 */
@Api(value = "质控设置管理接口", tags = { "质控设置管理接口" })
@RestController
@RequestMapping("/qualityControlSet")
public class QualityControlSetController {

    @Autowired
    IQualityControlSetService iQualityControlSetService;

    @ApiOperation(value = "获取日质控当前使用24小时质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentDayQualityControlParam", method = RequestMethod.GET)
    public ResultEntity currentDayQualityControlParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentDayQualityControlParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取日质控历史设置24小时质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyDayQualityControlParam", method = RequestMethod.GET)
    public ResultEntity historyDayQualityControlParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyDayQualityControlParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "设置日质控当前使用24小时质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "spanValue", value = "跨度值", paramType = "query", required = false, dataType = "Double"),
            @ApiImplicitParam(name = "zeroStandardValue", value = "零点标准溶液浓度", paramType = "query", required = false, dataType = "Double"),
            @ApiImplicitParam(name = "spanStandardValue", value = "跨度标准溶液浓度", paramType = "query", required = false, dataType = "Double") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentDayQualityControlParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentDayQualityControlParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentDayQualityControlParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核日质控当前使用24小时质控参数信息")
    @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "日质控参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentDayQualityControlParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentDayQualityControlParam(String id) {
        return iQualityControlSetService.auditCurrentDayQualityControlParam(id);
    }

    @ApiOperation(value = "获取周质控当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentWeekQualityControlParam", method = RequestMethod.GET)
    public ResultEntity currentWeekQualityControlParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentWeekQualityControlParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取周质控历史质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyWeekQualityControlParam", method = RequestMethod.GET)
    public ResultEntity historyWeekQualityControlParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyWeekQualityControlParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "设置周质控当前使用周质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "standardValue", value = "标准溶液浓度", paramType = "query", required = false, dataType = "Double") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentWeekQualityControlParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentWeekQualityControlParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentWeekQualityControlParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核周质控当前使用周质控参数信息")
    @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "周质控参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentWeekQualityControlParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentWeekQualityControlParam(String id) {
        return iQualityControlSetService.auditCurrentWeekQualityControlParam(id);
    }

    @ApiOperation(value = "获取月质控多点线性核查当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentMonthQualityControlMultipointParam", method = RequestMethod.GET)
    public ResultEntity currentMonthQualityControlMultipointParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentMonthQualityControlMultipointParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取历史月质控多点线性核查质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyMonthQualityControlMultipointParam", method = RequestMethod.GET)
    public ResultEntity historyMonthQualityControlMultipointParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyMonthQualityControlMultipointParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "获取月质控多点线性核查质控设置参数内零点核查信息")
    @ResponseBody
    @RequestMapping(value = "/monthQualityControlMultipointParamZeroDrift", method = RequestMethod.GET)
    public ResultEntity monthQualityControlMultipointParamZeroDrift(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.monthQualityControlMultipointParamZeroDrift(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取月质控多点线性核查质控设置参数内跨度核查信息")
    @ResponseBody
    @RequestMapping(value = "/monthQualityControlMultipointParamSpanDrift", method = RequestMethod.GET)
    public ResultEntity monthQualityControlMultipointParamSpanDrift(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.monthQualityControlMultipointParamSpanDrift(qualityParamSelectBo);
    }

    @ApiOperation(value = "设置月质控多点线性核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "sourceValues", value = "6个点的数据来源集合", paramType = "query", required = false, dataType = "String", allowMultiple = true),
            @ApiImplicitParam(name = "pointValues", value = "6个点的数据集合", paramType = "query", required = false, dataType = "Double", allowMultiple = true) })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentMonthQualityControlMultipointParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentMonthQualityControlMultipointParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentMonthQualityControlMultipointParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核月质控多点线性核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "月质控多点线性核查参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentMonthQualityControlMultipointParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentMonthQualityControlMultipointParam(String id) {
        return iQualityControlSetService.auditCurrentMonthQualityControlMultipointParam(id);
    }

    @ApiOperation(value = "获取月质控集成干预核查当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentMonthQualityControlIntegratedParam", method = RequestMethod.GET)
    public ResultEntity currentMonthQualityControlIntegratedParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentMonthQualityControlIntegratedParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取历史月质控集成干预核查质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyMonthQualityControlIntegratedParam", method = RequestMethod.GET)
    public ResultEntity historyMonthQualityControlIntegratedParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyMonthQualityControlIntegratedParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "设置月质控集成干预核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "notIntegratedTime", value = "未过集成测试时间", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "overIntegratedTime", value = "已过集成测试时间", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentMonthQualityControlIntegratedParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentMonthQualityControlIntegratedParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentMonthQualityControlIntegratedParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核月质控集成干预核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "月质控集成干预核查参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentMonthQualityControlIntegratedParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentMonthQualityControlIntegratedParam(String id) {
        return iQualityControlSetService.auditCurrentMonthQualityControlIntegratedParam(id);
    }

    @ApiOperation(value = "获取月质控实际水样对比当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentMonthQualityControlRealWaterParam", method = RequestMethod.GET)
    public ResultEntity currentMonthQualityControlRealWaterParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentMonthQualityControlRealWaterParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "设置月质控实际水样对比质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "testTime", value = "水样测试时间", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentMonthQualityControlRealWaterParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentMonthQualityControlRealWaterParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentMonthQualityControlRealWaterParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核月质控实际水样对比质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "月质控实际水样对比参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentMonthQualityControlRealWaterParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentMonthQualityControlRealWaterParam(String id) {
        return iQualityControlSetService.auditCurrentMonthQualityControlRealWaterParam(id);
    }

    @ApiOperation(value = "获取月质控加标回收率当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentMonthQualityControlRecoveryParam", method = RequestMethod.GET)
    public ResultEntity currentMonthQualityControlRecoveryParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentMonthQualityControlRecoveryParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取历史月质控加标回收率质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyMonthQualityControlRecoveryParam", method = RequestMethod.GET)
    public ResultEntity historyMonthQualityControlRecoveryParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyMonthQualityControlRecoveryParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "设置月质控加标回收率质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "addConcentration", value = "加标样浓度", paramType = "query", required = false, dataType = "Double"),
            @ApiImplicitParam(name = "constantVolume", value = "定容体积", paramType = "query", required = false, dataType = "Double") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentMonthQualityControlRecoveryParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentMonthQualityControlRecoveryParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentMonthQualityControlRecoveryParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核月质控加标回收率质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "月质控加标回收率参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentMonthQualityControlRecoveryParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentMonthQualityControlRecoveryParam(String id) {
        return iQualityControlSetService.auditCurrentMonthQualityControlRecoveryParam(id);
    }

    @ApiOperation(value = "获取月质控标样核查当前使用质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/currentMonthQualityControlStandardCheckParam", method = RequestMethod.GET)
    public ResultEntity currentMonthQualityControlStandardCheckParam(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.currentMonthQualityControlStandardCheckParam(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取历史月质控标样核查质控参数信息")
    @ResponseBody
    @RequestMapping(value = "/historyMonthQualityControlStandardCheckParam", method = RequestMethod.GET)
    public ResultEntity historyMonthQualityControlStandardCheckParam(QualityParamSelectBo qualityParamSelectBo, PageObject pageObject) {
        return iQualityControlSetService.historyMonthQualityControlStandardCheckParam(qualityParamSelectBo, pageObject);
    }

    @ApiOperation(value = "设置月质控标样核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCodes", value = "站点编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "indexCode", value = "监测项编码", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "spanValue", value = "跨度值", paramType = "query", required = false, dataType = "Double"),
            @ApiImplicitParam(name = "standardValue", value = "标准溶液浓度", paramType = "query", required = false, dataType = "Double") })
    @ResponseBody
    @RequestMapping(value = "/editorCurrentMonthQualityControlStandardCheckParam", method = RequestMethod.POST)
    public ResultEntity editorCurrentMonthQualityControlStandardCheckParam(@RequestBody List<QualityParamSetBo> qualityParamSetBoList) {
        return iQualityControlSetService.editorCurrentMonthQualityControlStandardCheckParam(qualityParamSetBoList);
    }

    @ApiOperation(value = "审核月质控标样核查质控参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "月质控标样核查参数唯一标识", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/auditCurrentMonthQualityControlStandardCheckParam", method = RequestMethod.POST)
    public ResultEntity auditCurrentMonthQualityControlStandardCheckParam(String id) {
        return iQualityControlSetService.auditCurrentMonthQualityControlStandardCheckParam(id);
    }

    @ApiOperation(value = "获取设备的设置参数信息")
    @ResponseBody
    @RequestMapping(value = "/getEquipmentParameter", method = RequestMethod.GET)
    public ResultEntity getEquipmentParameter(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.getEquipmentParameter(qualityParamSelectBo);
    }

    @ApiOperation(value = "设置设备的参数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "parameterId", value = "设备参数ID", paramType = "query", required = false, dataType = "String"),
            @ApiImplicitParam(name = "parameterValue", value = "设备参数值", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/editorEquipmentParameter", method = RequestMethod.GET)
    public ResultEntity editorEquipmentParameter(String parameterId, String parameterValue) {
        return iQualityControlSetService.editorEquipmentParameter(parameterId, parameterValue);
    }

    @ApiOperation(value = "获取站点的当前水质数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stationCode", value = "站点编码", paramType = "query", required = false, dataType = "String") })
    @ResponseBody
    @RequestMapping(value = "/getStationCurrentWaterQualityData", method = RequestMethod.GET)
    public ResultEntity getStationCurrentWaterQualityData(String stationCode) {
        return iQualityControlSetService.getStationCurrentWaterQualityData(stationCode);
    }

    @ApiOperation(value = "获取周质控、多点线性、集成干预、加标回收、标样核查历史一栏结论信息")
    @ResponseBody
    @RequestMapping(value = "/qualityControlConclusion", method = RequestMethod.GET)
    public ResultEntity qualityControlConclusion(QualityParamSelectBo qualityParamSelectBo) {
        return iQualityControlSetService.qualityControlConclusion(qualityParamSelectBo);
    }

    @ApiOperation(value = "获取日质控、周质控、多点线性、集成干预、实际水样对比、加标回收、标样核查温馨提示信息")
    @ResponseBody
    @RequestMapping(value = "/qualityControlTips", method = RequestMethod.GET)
    public ResultEntity qualityControlTips(QualityParamSelectBo qualityParamSelectBo) {
        // 缺失配置参数是否使用的条件
        return iQualityControlSetService.qualityControlTips(qualityParamSelectBo);
    }
}
